What is causing the TypeError in my print statement in Python